package Frame;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;

public class EmployeeInFrame {
    public static void main(String[] args) {
        JFrame jFrame =new JFrame("公司职员信息");
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jFrame.setSize(300,300);
        jFrame.setLayout(new GridLayout(8,2));
        JLabel idLabel =new JLabel("身份证号码");
        JTextField idTextField = new JTextField();
        JLabel name = new JLabel("姓名");
        JTextField nameTextField = new JTextField();
        JLabel sexLabel =new JLabel("性别");
        JTextField sexTextField = new JTextField();
        JLabel birthdayLabel =new JLabel("出生日期");
        JTextField birthdayTextField = new JTextField();
        JLabel homeLabel =new JLabel("籍贯");
        JTextField homeTextField = new JTextField();
        JLabel addressLabel =new JLabel("居住地");
        JTextField addressTextField = new JTextField();
        JLabel numberLabel =new JLabel("职工号");
        JTextField numberTextField = new JTextField();
        JButton exitButton =new JButton("退出");
        exitButton.addActionListener(new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                jFrame.dispose();
            }
        });
        jFrame.add(idLabel);
       //jFrame.add(idTextField);
        jFrame.add(name);
        //jFrame.add(nameTextField);
        jFrame.add(sexLabel);
       // jFrame.add(sexTextField);
        jFrame.add(birthdayLabel);
        //jFrame.add(birthdayTextField);

        jFrame.add(homeLabel);
       //jFrame.add(homeTextField);
        jFrame.add(addressLabel);
        //jFrame.add(addressTextField);
        jFrame.add(numberLabel);
        //jFrame.add(nameTextField);
        jFrame.add(exitButton);
        jFrame.setVisible(true);
    }
}
